package 华为机试;

import java.util.Scanner;

public class HJ1_字符串最后一个单词的长度 {
    public  static void  main(String [] args) throws Exception{
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char[] tmp = str.toCharArray();
        StringBuilder sb = new StringBuilder();
        int i = tmp.length-1;
        while(tmp[i] != ' ') {
            sb.append(tmp[i--]);
            if(i < 0) {
                break;
            }
        }
        System.out.println(sb.length());
    }
}
